<?php

$old_config = require(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'common_config.php');
$config = array(
    'basePath' => dirname(__FILE__) . DIRECTORY_SEPARATOR . '..',
    'name' => '1折网 淘牛品 1zw taoniupin',
    'defaultController' => 'front/index',
    'language' => 'zh_cn',
    // preloading 'log' component
    'preload' => array('log'),
    'aliases' => array(
        'theme' => 'webroot.themes.1zw',
        'bootstrap' => 'application.modules.bootstrap',
    ),
    // autoloading model and component classes
    'import' => array(
        'application.models.*',
        'application.components.*',
    ),
    'modules' => $old_config['modules'],
    // application components
    'components' => array(
        'user' => array(
            // enable cookie-based authentication
            //'allowAutoLogin' => true,
            'class' => 'UserPassport',
        ),
        // uncomment the following to enable URLs in path-format
        /*
          'urlManager'=>array(
          'urlFormat'=>'path',
          'rules'=>array(
          '<controller:\w+>/<id:\d+>'=>'<controller>/view',
          '<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
          '<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
          ),
          ),
         */
        // uncomment the following to use a MySQL database
        'errorHandler' => array(
            // use 'site/error' action to display errors
            'errorAction' => 'site/error',
        ),
        'log' => array(
            'class' => 'CLogRouter',
            'routes' => array(
                array(
                    'class' => 'CFileLogRoute',
                    'levels' => 'error, warning',
                ),
            // uncomment the following to show log messages on web pages
            /*
              array(
              'class'=>'CWebLogRoute',
              ),
             */
            ),
        ),
        'cache' => array(
            'class' => 'system.caching.CDummyCache',
        ),
        'bsHtml' => array(
            'class' => 'bootstrap.components.BSHtml'
        ),
        'urlManager' => array(
            'urlFormat' => 'path',
            'showScriptName' => false, //隐藏index.php   
            'urlSuffix' => '.html', //后缀   
            'rules' => array(
                'k<gid:\d+>' => 'front/good/skip',
                'http://m.1zw.com<_q:.*>/*' => 'wap<_q>',
                'http://appdev.1zw.com<_q:.*>/*' => 'app<_q>',
                'g<gid:\d+>' => 'front/good/show',
                'cat/<cid:\d+>' => 'front/index/index',
                'index' => 'front/index/index',
                'jd' => 'front/cat/jd',
                'jj' => 'front/cat/jj',
                'cat-menu/<cid:\d+>' => 'front/cat/index',
                'tomorrow' => 'front/cat/tomorrow',
                'ycid/<cid:\d+>' => 'front/cat/yesterday',
                'baoming' => 'user/bm/bm',
                'query' => 'front/bm/lookup',
                'article/<id:\d+>' => 'front/article/show',
                'anquan/<id:\d+>' => 'front/article/anquan',
                'qing' => 'front/index/qing',
                'tmall' => 'front/index/tmall',
                'nohf' => 'front/index/nohf',
                'huodong' => 'front/cat/promotion',
                'sitemap' => 'front/index/sitemap',
                'jifen' => 'front/index/score',
                'shangjia' => 'front/special/index',
                'tag-<tag:\w+>' => 'front/index/tag',
                'zc' => 'front/index/zhuanchang',
            ),
        ),
    ),
    'theme' => $old_config['theme'],
    // application-level parameters that can be accessed
    // using Yii::app()->params['paramName']
    'params' => $old_config['params'],
);

$config['params']['sinaAPI'] = array(
    'WB_AKEY' => "526570810",
    'WB_SKEY' => "c9d28a326bbfabf038352e7d8582b9b6",
    'WB_CALLBACK_URL' => "http://cs.1zw.com/user/oauth/sina"
);
$config['params']['QQAPI'] = array(
    'appid' => "101142447",
    'appkey' => "6f13b2dfe294c93b3c632875ba3a37ce",
    'callback' => "http://cs.1zw.com/user/oauth/qq",
    'scope' => "get_user_info,add_t,add_pic_t"
);
$config['params']['RedisConfig'] = array(
    'host' => '127.0.0.1',
    'port' => 6379,
);

$database = array(
    'cache' => array(
        //'class' => 'OSCMemcached',
        'class' => 'CMemCache',
//        'osc' => array(
//            array(
//                'host' => '2b775095126611e4.m.cnhzalicm10pub001.ocs.aliyuncs.com',
//                'port' => 11211,
//                'weight' => 60,
//                'username' => '2b775095126611e4',
//                'password' => 'Sefsw24104445',
//            ),
//        ),
        'servers' => array(
            array(
                'host' => '127.0.0.1',
                'port' => 11211,
                'weight' => 60,
            ),
        ),
    ),
    'db' => array(
        'connectionString' => "mysql:host=121.40.128.20;dbname=1zw",
        'emulatePrepare' => true,
        'username' => '1zw',
        'password' => '123456',
        'charset' => 'utf8',
        'tablePrefix' => 'tk_',
    ),
);
$config['components'] = CMap::mergeArray($config['components'], $database);
return $config;
